<?php
/**
 * Created by PhpStorm.
 * User: YH
 * Date: 2019/5/11
 * Time: 14:22
 */

function dbHelper($sql){
    $dbHost="127.0.0.1";
    $dbName="root";
    $dbPwd="";
    $dataBase="miyaw";
    $dbPort="3306";

    $conn=new mysqli("$dbHost",$dbName,$dbPwd,$dataBase,$dbPort);
    mysqli_query($conn,"set names utf8");

    $result=$conn->query($sql);
    $conn->close();
    return $result;
}